package com.athena.controller {
	import com.athena.utils.Util;
	import com.athena.view.GameBoard;
	import flash.display.Sprite;
	/**
	 * ...
	 * @author chau
	 */
	public class Handle 
	{
		private var _mainMovie : Sprite;
		public function Handle(main : Sprite) 
		{
			_mainMovie = main;
		}
		
		private function gotoTable() : void {
			if (Main.getInstance().gameBoard) {
				resetBoard();
			}else {
				Main.getInstance().gameBoard = new GameBoard();
			}
			Main.getInstance().removeChild(Main.getInstance().dashBoard.movie);
			Main.getInstance().addChild(Main.getInstance().gameBoard);
		}
		private function resetBoard() : void {
			
		}
		public function createTable(str : String) : void {
			Main.getInstance().gameObject.IsCreate = true;
			
			//goto gameboad
			gotoTable();
			
			Util.removeLoad();
		}
		
		public function joinTable(str : String) : void {
			Main.getInstance().gameObject.IsCreate = false;
			//goto gameboad
			
			Util.removeLoad();
		}
		
		public function otherJoinTable(str : String) : void {
			// app player
		}
		
		public function leaveTable(_id : int) : void {
			
		}
		
		public function readyTable(_name : String) : void {
			
		}
		public function ccTable(_name : String) : void {
			
		}
		public function vTable(_name : String) : void {
			
		}
		public function get mainMovie():Sprite 
		{
			return _mainMovie;
		}
		
	}

}